﻿using System;
using System.Collections.Specialized;

namespace XMLParsers.DOM
{
    public class XmlDomElement
    {
      public string TagName { get; set; }
      public string Text  { get; set; }
      public StringDictionary Attributes { get; private set; }
      public XmlDomElements ChildElements { get; private set; }


      public XmlDomElement(String tagName)
      {
         TagName = tagName;
         Attributes = new StringDictionary();
         ChildElements = new XmlDomElements();
         Text="";
      }

      public String Attribute(String name) 
      {
         return Attributes[name];
      }

      public void SetAttribute(String name, String value) 
      {
         Attributes.Add(name, value);
      }
    }
}
